using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using MinCultura.Sipa.AgentesArtes;

namespace web
{
    public partial class UniversidadFormularios : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //DateTime dt = DateTime.Now;
            //Label1.Text = dt.ToString("HH:mm:ss:fffffff");
        }

        protected void ddlPrograma_SelectedIndexChanged(object sender, EventArgs e)
        {

            
        
            //cargar radiobutton lis con los informes
            BasicasColombiaCreativa obj= new BasicasColombiaCreativa(ConfigurationManager.AppSettings["conn"]);
            DataTable objTable = obj.BuscarPasBuscarCcrInformes(ddlPrograma.SelectedValue);
            if(objTable.Rows.Count > 0)
            {
                rblistFormularios.DataSource = objTable;
                rblistFormularios.DataTextField = "INFORME";
                rblistFormularios.DataValueField = "ID";
                rblistFormularios.DataBind();

            }
            ifrFormulario1.Attributes["src"] = "http://www.sinic.gov.co/ColombiaCreativa/InformesCCR/CCR_INFORME_1/blankpage.aspx";// + "?id=" + objItem.Value; 

        }

        protected void rblistFormularios_SelectedIndexChanged(object sender, EventArgs e)
        {
            foreach (ListItem objItem in rblistFormularios.Items)
            {
                if (objItem.Text == "INFORME 1" && objItem.Selected)
                {
                    ifrFormulario1.Attributes["src"] = "http://www.sinic.gov.co/ColombiaCreativa/InformesCCR/CCR_INFORME_1/ShowCCR_INFORME_1TablePage.aspx" + "?id=" + objItem.Value;
                    return;
                }
                else if (objItem.Text == "INFORME 2" && objItem.Selected)
                {
                    ifrFormulario1.Attributes["src"] = "http://www.sinic.gov.co/ColombiaCreativa/InformesCCR/CCR_INFORME_2/ShowCCR_INFORME_2TablePage.aspx" + "?id=" + objItem.Value;
                    return;
                }
                else
                    ifrFormulario1.Attributes["src"] = "http://www.sinic.gov.co/ColombiaCreativa/InformesCCR/CCR_INFORME_1/blankpage.aspx";// + "?id=" + objItem.Value; 
            }
            
        }
    }
}
